<!--
Edgar Garibay Ruiz
is217618
11 de Septiembre 2011
Version 3	

Se declara la clase Client y se crea un instancia de la misma con los datos de POST
-->

<html>

	<head>
		<link rel="stylesheet" type="text/css" href="css/general.css">
	</head>
	
	<body>
		<?php
			class Client{
				public $name;
				public $phone;
				public $email;
				
				public function __construct($name){
					$this->name = $name;
				}
				
				public function agrgar(){
				}
				
				public function modificar($property,$value){
					switch($property){
						case "name":
							$this->name = $value;
						break;
						case "phone":
							$this->phone = $value;
						break;
						case "email":
							$this->email = $value;
						break;						
					}					
				}
				
				public function borrar(){
					$this->name = "";
					$this->phone = "";
					$this->email = "";
				}
				
			}
			
		
		
		?>
		
		<?php
			$name = $_POST['nombre'];
			
			$cliente = new Client($name);
			$cliente->modificar("phone",$_POST['telefono']);
			$cliente->modificar("email",$_POST['mail']);
			
			echo "Nombre: " .$cliente->name."<br>";
			echo "Telefono: " .$cliente->phone."<br>";
			echo "E-mail: " .$cliente->email."<br>";
			
			
		?>
	</body>

</html>

